package yxy.cherry.battle.module.selector;

import yxy.cherry.battle.Fighter;
import yxy.cherry.battle.Team;
import yxy.cherry.battle.module.affix.AffixContext;
import yxy.cherry.battle.module.affix.AffixContext.AffixAction;

import java.util.Set;

public class TargetSelector_3_行动者 extends TargetSelector {

	@Override
	public Set<Fighter> target(Fighter actor, Team team, int param1, int param2) {
		Fighter target = getAffixAction(actor).get行动者();
		if (target.is活着()) {
			return packTarget(target);
		}
		return null;
	}

	protected AffixAction getAffixAction(Fighter actor) {
		AffixContext affixContext = actor.getAffixContext();
		if (affixContext.is附加行动中()) {
			return affixContext.get附加行动();
		}
		return affixContext.get攻击行动();
	}
}
